using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TPI_LOGMap : EntityTypeConfiguration<TPI_LOG>
    {
        public TPI_LOGMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FileName)
                .HasMaxLength(50);

            this.Property(t => t.Status)
                .IsFixedLength()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("TPI_LOG");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Interface).HasColumnName("Interface");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.FileName).HasColumnName("FileName");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Messages).HasColumnName("Messages");
            this.Property(t => t.User).HasColumnName("User");
        }
    }
}
